
<!DOCTYPE html>
<html lang="">


<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  <meta name="theme-color" content="#202020"/>
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <script src="/js/busuanzi.pure.mini.js" async></script>
  
  
    <meta name="keywords" content="Java,idea-plugin," />
  

  
    <meta name="description" content="一个专注一coding的网站。提供丰富编程知识，包括Spring、Java、EmberJS、SpringBoot等等技术。" />
  
  
  <link rel="icon" type="image/x-icon" href="/image/favicon.ico">
  <title>官方FAQ(非常重要)——idea插件开发 [ Keep Coding ]</title>
  
    <!-- stylesheets list from config.yml -->
    
      <link rel="stylesheet" href="/css/pure-min.css">
    
      <link rel="stylesheet" href="/css/xoxo.css">
    
  
<meta name="generator" content="Hexo 5.0.2"><link rel="alternate" href="/atom.xml" title="Keep Coding" type="application/atom+xml">
</head>

<body>
  <div class="nav-container">
    <nav class="home-menu pure-menu pure-menu-horizontal">
  <a class="pure-menu-heading" href="/">
    <img class="avatar" src="/image/favicon.ico">
    <span class="title">Keep Coding</span>
  </a>

  <ul class="pure-menu-list clearfix">
      
          
            <li class="pure-menu-item"><a href="/" class="pure-menu-link">首页</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/archives" class="pure-menu-link">归档</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/tags" class="pure-menu-link">标签</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/search" class="pure-menu-link">搜索</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/about" class="pure-menu-link">关于</a></li>
          
      
          
            <li class="pure-menu-item"><a href="/atom.xml" class="pure-menu-link">订阅</a></li>
          
      
  </ul>
   
</nav>
  </div>

  <div class="container" id="content-outer">
    <div class="inner" id="content-inner">
      <div class="post-container">
  <article class="post" id="post">
    <header class="post-header text-center">
      <h1 class="title">
        官方FAQ(非常重要)——idea插件开发
      </h1>
      <span>
        
        <time class="time" datetime="2020-01-20T17:42:24.000Z">
        2020-01-21
      </time>
        
      </span>
      <span class="slash">/</span>
      <span class="post-meta">
      <span class="post-tags">
        <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Java/" rel="tag">Java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/idea-plugin/" rel="tag">idea-plugin</a></li></ul>
      </span>
    </span>
      <span class="slash">/</span>
      <span class="read">
      <span id="busuanzi_value_page_pv"></span> 点击
    </span>
      <span class="slash">/</span>
      <span class="read">阅读耗时 7 分钟</span>
    </header>

    <div class="post-content">
      <h3 id="Plugin-Development-FAQ"><a href="#Plugin-Development-FAQ" class="headerlink" title="Plugin Development FAQ"></a>Plugin Development FAQ</h3><p>This FAQ is a topical index of questions that have been asked (and answered) on our <a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development">IntelliJ IDEA Open API and Plugin Development forum</a>.</p>
<h4 id="Open-Source-Plugins"><a href="#Open-Source-Plugins" class="headerlink" title="Open-Source Plugins"></a>Open-Source Plugins</h4><ul>
<li><a target="_blank" rel="noopener" href="https://github.com/jetbrains/intellij-scala#setting-up-the-project">How do I compile the Scala plugin?</a></li>
</ul>
<h4 id="Open-Source-Plugins-1"><a href="#Open-Source-Plugins-1" class="headerlink" title="Open-Source Plugins"></a>Open-Source Plugins</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206130119-Triggering-AnAction-instances-">How do I trigger actions programmatically?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206750335-Add-new-Main-menu-option-for-plugin">How do I add a main menu item?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206765055-Overriding-the-New-context-menu-in-the-Project-view">How do I customize the “New…” menu?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142169-How-to-add-a-menu-item-below-Exclude-From-Compile-">How do I customize the compiler output context menu?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206756455-Question-about-Actions">How do I get the context of an action (selected file, active project etc.)?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206763405-How-to-dynamically-change-icons-in-the-tool-bar-">How do I change the icon of an action dynamically?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206151289-How-to-add-icons-to-the-toolbar-">How do I add icons to the IDEA toolbar?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206126699-List-of-built-in-action-ID-s-">Where do I get the list of built-in action IDs?</a></li>
</ul>
<h4 id="Accessing-and-Modifying-the-Source-Code"><a href="#Accessing-and-Modifying-the-Source-Code" class="headerlink" title="Accessing and Modifying the Source Code"></a>Accessing and Modifying the Source Code</h4><ul>
<li><a target="_blank" rel="noopener" href="http://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/psi.html">PSI Architectural Overview</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791895-finding-all-derived-class-given-parent-class">How do I find all subclasses of a class?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206792205-How-to-find-anonymous-classes-in-PsiClass-">How do I find all anonymous classes created in a class?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139829-How-to-evaluate-the-value-of-PsiJavaToken-of-STRING-LITERAL-type">How do I calculate the value of a string literal token?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791825-How-to-rename-a-class-">How do I rename or move a Java class?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139469-Using-DependencyValidationManager-to-Get-Required-Classes">How do I build the list of all classes used by a given class or package?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143839-Adding-PsiElements-to-a-PsiFile">How do I insert whitespace into the PSI?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142279-Dynamically-add-new-properties-to-properties-files">How do I add properties to a .properties file?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143579-finding-a-statement-within-a-PsiMethod">How do I find specific method calls inside a PsiMethod?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206796015-What-is-the-lifecycle-of-a-PsiElement-">What is the lifecycle of a PSI element?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206768795-How-to-search-file-by-file-name-in-project-s-root-directory-">How do I find a file given its name (but no path)?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206771665-Creating-a-new-class">How do I create a new class in the given package?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206794255-How-to-make-a-PsiClass-derive-from-another-one-">How do I make a PsiClass extend another PsiClass?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800695-How-to-obtain-the-references-to-a-class-from-non-java-files-">How do I find references to a class from non-Java files?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800595-How-to-find-the-source-for-a-class-file">How do I find the source file given the path to a .class file?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206146759-How-to-resolve-unqualified-name-to-possible-PsiClasses-">How do I find classes with the specified non-qualified name?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206103859-How-to-get-Module-from-PsiClass-">How do I find the module in which a class is located?</a></li>
<li><a target="_blank" rel="noopener" href="http://www.jetbrains.org/intellij/sdk/docs/basics/psi_cookbook.html">PSI Cookbook</a></li>
</ul>
<h4 id="Working-with-XML-and-XML-DOM"><a href="#Working-with-XML-and-XML-DOM" class="headerlink" title="Working with XML and XML DOM"></a>Working with XML and XML DOM</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139639-Change-xml-attribute-value">How do I change the value of an XML attribute through the PSI?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206795875-XmlTagValue-reference-to-Java-methods">How do I add custom references to Java elements in XML files?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206795425-How-to-register-DTD-with-idea">How do I programmatically register a DTD or schema?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791535-DOM-DomElement-getParentOfType">What is the “strict” parameter in DomElement.getParentOfType()?</a></li>
</ul>
<h4 id="Code-Completion"><a href="#Code-Completion" class="headerlink" title="Code Completion"></a>Code Completion</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206133529-How-to-determine-what-type-of-code-completion-was-invoked">How do I determine what type of code completion was invoked?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139729-Custom-completion-in-editor">How do I provide additional code completion in specific places of a Java file?</a></li>
</ul>
<h4 id="Refactoring"><a href="#Refactoring" class="headerlink" title="Refactoring"></a>Refactoring</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206795955-Refactoring-Listeners">How can I receive notifications about refactoring events?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800005-How-to-invoke-refactoring-dialog-not-refactoring-itself-">How do I show a refactoring dialog programmatically?</a></li>
</ul>
<h4 id="Run-Debug"><a href="#Run-Debug" class="headerlink" title="Run/Debug"></a>Run/Debug</h4><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143009-Creating-a-Run-type-">How do I implement a custom run configuration?</a></p>
<h4 id="Make-Compile"><a href="#Make-Compile" class="headerlink" title="Make/Compile"></a>Make/Compile</h4><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800625-Implementing-a-ClassInstrumentingCompiler-how-to-get-the-generated-class-files">How do I get access to class files generated by javac?</a></p>
<h4 id="Version-Control-Integration"><a href="#Version-Control-Integration" class="headerlink" title="Version Control Integration"></a>Version Control Integration</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791585-Editor-diff-functionality-for-custom-file-system">Can I provide line status markers for files in a custom file system?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791975-VCS-context-menu">How do I update the state of VCS actions depending on file status?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206792195-Module-for-deleted-file-">How can I find out the module of a deleted file?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139549-Is-it-possible-to-decorate-change-lists-">Can I provide additional decorations for changelists in the Changes view?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791775-VCS-OpenAPI-what-to-do-with-files-detected-as-out-of-date-">How do I report out-of-date files?</a></li>
</ul>
<h4 id="Test-Framework"><a href="#Test-Framework" class="headerlink" title="Test Framework"></a>Test Framework</h4><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791555-library-depndency-in-InspectionTestCase">How do I create a library dependency in my test module?</a></p>
<h4 id="Plugin-Architecture"><a href="#Plugin-Architecture" class="headerlink" title="Plugin Architecture"></a>Plugin Architecture</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206793965-Custom-exception-reporting">How do I provide a custom exception reporter for my plugin?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206760095-how-do-i-plug-into-the-main-idea-help-system-">How can I add the help topics of my plugin to the IntelliJ Platform help system?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800275-How-to-get-the-idea-version">How do I get the version of IntelliJ Platform under which my plugin is running?</a></li>
</ul>
<h4 id="Editors-Documents-and-Files"><a href="#Editors-Documents-and-Files" class="headerlink" title="Editors, Documents and Files"></a>Editors, Documents and Files</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791625-Action-doesn-t-see-changes-in-xml-file">Why doesn’t the file change on disk after I changed it through the PSI?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206790685-Can-you-tie-into-the-file-save-logic-">Can I hook into the file save logic?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/207042355-Read-only-section-in-editor">Can I mark a part of a file as read-only?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791375-Using-locked-regions">How do I control what happens when the user tries to edit such a part?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143969-Rough-guide-to-xml-gui-editor-type-plugin-">How do I implement a custom editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206795495-Alternative-Editors-ala-HTML-Preview">How can I show several editors for a single file in tabs?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206135449-Create-an-Editor-for-a-non-physical-file">Can I open an editor which has no underlying file on disk?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206792085-Catching-the-Save-All-action">How do I save the content of my custom editor when the user saves all documents?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143909-MarkupModel-navigate-highlighted-elements">How do I highlight elements in a source code editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143879-HighlightManager-how-to-enable-F3-functionality">How do I allow to navigate between highlighted elements using Find Next?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143679-Forcing-an-annotator-to-update-status-of-a-file">How do I force code to be re-analyzed?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206141119-how-to-get-the-Editor-from-PsiElement-">How do I get the active editor instance?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206794335-How-to-get-cursor-position-in-the-current-editor-">How do I get the cursor position in the current editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142039-Clear-read-only-status">How do I clear the read-only status of a file?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206146719-HintManager-API-question">How do I show a popup hint in an editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800165-How-to-%C3%A7reate-live-template-like-red-box-edit-regions-in-an-editor">How do I create live template-like red box edit regions in an editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206146679-Error-highlighting-in-Editors">How can I show an editor with error highlighting in a tool window?</a></li>
</ul>
<h4 id="Inspections"><a href="#Inspections" class="headerlink" title="Inspections"></a>Inspections</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139579-LocalInspectionTool-for-XML-files-/comments/206204765">Can I build an inspection that processes XML files?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142489-visitXmlAttribute-question">Why are the inspection results shown multiple times?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142769-Triggering-Create-Method-intention">How can I provide a quick fix that creates a method?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800645-How-to-inspect-only-the-elements-modified-since-the-last-class-inspection">Is it possible to inspect only the elements that have been modified after the last full inspection?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000337510-Only-trigger-externalAnnotator-when-the-file-system-is-in-sync">ExternalAnnotator not in sync with current editor</a></li>
</ul>
<h4 id="Project-Structure"><a href="#Project-Structure" class="headerlink" title="Project Structure"></a>Project Structure</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206137859-Dependency-storage-formats-">Can I add a new module dependency storage format?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143559-Usage-of-class-Pair-A-B-">What is the Pair to be passed to JavaModuleBuilder.setSourcePaths()?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206141569-selecting-a-configured-jdk">How do I access all configured JDKs?</a></li>
</ul>
<h4 id="Custom-Languages"><a href="#Custom-Languages" class="headerlink" title="Custom Languages"></a>Custom Languages</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791995-Parameter-Info">How do I provide Parameter Info support for my language?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139359-Autopopup-code-completion-in-custom-language">How do I provide auto-popup code completion in my language?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206797085-Custom-Language-How-to-make-a-closing-brace-unindent-">How to make a closing brace unindent?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206144059-How-the-insertion-of-closing-quote-works-in-Javascript-plugin-">How to automatically insert closing quotes?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206797015-Ctrl-mouse">How do I provide Ctrl+mouse popups for my language?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206786875-Debugging-custom-languages-">How do I enable debugging for my custom language which is compiled into Java?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143749-Custom-languages-masquarding-as-a-java-source-file-within-IntelliJ">How do I generate virtual Java classes mirroring the classes of my language?</a></li>
</ul>
<h4 id="User-Interface"><a href="#User-Interface" class="headerlink" title="User Interface"></a>User Interface</h4><ul>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791945-IDE-Notifications">How do I provide animated status bar notifications?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139509-Combobox-with-Browse-Button-and-Autocompletion-">How do I enable file name completion in a combobox?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139049-popup-menu-with-left-and-right-aligned-items">How do I show a popup with left-aligned and right-aligned parts for each item?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206351479-Using-Browser-Component">Can I use an embedded Web browser from my plugin?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143779-Is-it-possible-to-change-icon-of-file-in-Project-view-">How do I provide a custom icon for files/PSI elements?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206139159-WriteActions-and-ProgressIndicator">Can I show a progress indicator for WriteActions?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206143999-DEMETRA-how-to-contribute-to-searchable-dialog-options-">How do I make it possible to search the options of my plugin in the Settings dialog?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142679-Opening-a-customised-StructureView">How do I show a custom window or popup based on Structure View?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206141229-is-it-possible-to-extend-the-project-tree-">Is it possible to extend the Project View tree?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206141379-Showing-Project-Strucuture-dialog-programmatically">How do I show the “Project Structure” dialog programmatically?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206141419-Putting-messages-into-console-window-">How do I print messages in the console view?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206794265-Package-selector-dialog">How do I show the package selector dialog programmatically?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800495-EditorTextField-in-3403-How-to-get-an-Editor-that-does-error-highlighting-">How do I provide syntax and error highlighting in a combo box editor?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206800405-How-can-i-run-some-code-when-a-ToolWindow-activates">How can I get notified when my tool window is activated?</a></li>
<li><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206146779-How-to-get-a-Close-button-in-an-own-Usage-View-">How can I provide Close and Rerun buttons in my Usage View window?</a></li>
<li><a target="_blank" rel="noopener" href="https://stackoverflow.com/questions/51499884/how-to-display-the-sdk-list-in-a-jcombobox">How can I display the SDK list in a JComboBox?</a></li>
</ul>
<h4 id="General"><a href="#General" class="headerlink" title="General"></a>General</h4><ul>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206763335-Getting-active-project-">How do I get the currently active project outside of an AnAction?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206792155-Detecting-frame-project-closing">How do I detect when a project is closing?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206142959-Stack-Analyzer-extension">How can I implement a custom stack trace analyzer?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206794095-Where-is-ApplicationComponent-state-stored-in-">Where is the state of an ApplicationComponent stored?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206146969-how-to-open-a-project-">How do I open a project programmatically?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206121889-How-to-get-the-folder-of-currenctly-selected-file">How do I get the folder of the currently selected file?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206147039-JDOMExternalizable-and-encrypting-">How do I encrypt some values in the configuration data of my plugin?</a></p>
</li>
<li><p><a target="_blank" rel="noopener" href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206762245-How-can-I-track-plugin-s-exceptions-/comments/206112345">How can I track exceptions from my plugin?</a></p>
</li>
</ul>

    </div>

      
    <div class="post-nav">
      <div class="post-nav-item post-nav-next">
        
          <span>〈 </span>
          <a href="/2020/01/19/idea-plugin/%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E2%80%94%E2%80%94idea%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91/" rel="next" title="环境搭建——idea插件开发">
          环境搭建——idea插件开发
          </a>
        
      </div>
  
      <div class="post-nav-item post-nav-prev">
          
          <a href="/2020/04/19/Spring/Spring%E6%BA%90%E7%A0%81%E5%AD%A6%E4%B9%A0/" rel="prev" title="Spring源码学习">
            Spring源码学习
          </a>
          <span>〉</span>
        
      </div>
    </div>
  
  </article>
  <div class="toc-container">
    
  <div id="toc" class="toc-article">
    <strong class="toc-title">目录</strong>
    <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Plugin-Development-FAQ"><span class="toc-text">Plugin Development FAQ</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Open-Source-Plugins"><span class="toc-text">Open-Source Plugins</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Open-Source-Plugins-1"><span class="toc-text">Open-Source Plugins</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Accessing-and-Modifying-the-Source-Code"><span class="toc-text">Accessing and Modifying the Source Code</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Working-with-XML-and-XML-DOM"><span class="toc-text">Working with XML and XML DOM</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Code-Completion"><span class="toc-text">Code Completion</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Refactoring"><span class="toc-text">Refactoring</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Run-Debug"><span class="toc-text">Run&#x2F;Debug</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Make-Compile"><span class="toc-text">Make&#x2F;Compile</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Version-Control-Integration"><span class="toc-text">Version Control Integration</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Test-Framework"><span class="toc-text">Test Framework</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Plugin-Architecture"><span class="toc-text">Plugin Architecture</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Editors-Documents-and-Files"><span class="toc-text">Editors, Documents and Files</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Inspections"><span class="toc-text">Inspections</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Project-Structure"><span class="toc-text">Project Structure</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Custom-Languages"><span class="toc-text">Custom Languages</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#User-Interface"><span class="toc-text">User Interface</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#General"><span class="toc-text">General</span></a></li></ol></li></ol>
  </div>


  </div>
</div>


<div class="copyright">
    <span>本作品采用</span>
    <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by/4.0/">知识共享署名 4.0 国际许可协议</a>
    <span>进行许可。 转载时请注明原文链接。</span>
</div>
<div class="share">

</div>
<div class="post-container">
    <article class="post">
      <div id="container"></div>
    </article>
</div>

<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
  id: '官方FAQ(非常重要)——idea插件开发', // 可选。默认为 location.href
  owner: 'ubuntuvim',
  repo: 'ubuntuvim.github.io',
  oauth: {
    client_id: '48b3df0bf4ba1743e0a3',
    client_secret: 'c6c2cec09acb5eecc9d325d56cef187264aa1e16',
  },
})
gitment.render('container')
</script>



    </div>

    

  </div>
  <footer class="footer text-center">
    <div id="bottom-inner">
        <a class="bottom-item" href="http://xcoding.tech/">首页</a> |
        <a class="bottom-item" href="http://xcoding.tech/" target="_blank">主站</a> |
        <a class="bottom-item" href="https://github.com/ubuntuvim" target="_blank">GitHub</a> |
        <a class="bottom-item" href="https://hexo.io" target="_blank">Powered by hexo</a> |
        <a class="bottom-item" href="https://github.com/KevinOfNeu/hexo-theme-xoxo" target="_blank">Theme xoxo</a>
    </div>
</footer>


  <script src='https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js'></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize({theme: 'forest'});
    }
  </script>


  
  <!-- scripts list from theme config.yml -->
  
    <script src="/js/zepto.min.js"></script>
  


<script>
  (function(window, document, undefined) {

    var timer = null;

    function returnTop() {
      cancelAnimationFrame(timer);
      timer = requestAnimationFrame(function fn() {
        var oTop = document.body.scrollTop || document.documentElement.scrollTop;
        if (oTop > 0) {
          document.body.scrollTop = document.documentElement.scrollTop = oTop - 50;
          timer = requestAnimationFrame(fn);
        } else {
          cancelAnimationFrame(timer);
        }
      });
    }

    var hearts = [];
    window.requestAnimationFrame = (function() {
      return window.requestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.oRequestAnimationFrame ||
        window.msRequestAnimationFrame ||
        function(callback) {
          setTimeout(callback, 1000 / 60);
        }
    })();
    init();

    function init() {
      css(".heart{z-index:9999;width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}");
      attachEvent();
      gameloop();
      addMenuEvent();
    }

    function gameloop() {
      for (var i = 0; i < hearts.length; i++) {
        if (hearts[i].alpha <= 0) {
          document.body.removeChild(hearts[i].el);
          hearts.splice(i, 1);
          continue;
        }
        hearts[i].y--;
        hearts[i].scale += 0.004;
        hearts[i].alpha -= 0.013;
        hearts[i].el.style.cssText = "left:" + hearts[i].x + "px;top:" + hearts[i].y + "px;opacity:" + hearts[i].alpha + ";transform:scale(" + hearts[i].scale + "," + hearts[i].scale + ") rotate(45deg);background:" + hearts[i].color;
      }
      requestAnimationFrame(gameloop);
    }

    /**
     * 给logo设置点击事件
     * 
     * - 回到顶部
     * - 出现爱心
     */
    function attachEvent() {
      var old = typeof window.onclick === "function" && window.onclick;
      var logo = document.getElementById("logo");
      if (logo) {
        logo.onclick = function(event) {
          returnTop();
          old && old();
          createHeart(event);
        }
      }
      
    }

    function createHeart(event) {
      var d = document.createElement("div");
      d.className = "heart";
      hearts.push({
        el: d,
        x: event.clientX - 5,
        y: event.clientY - 5,
        scale: 1,
        alpha: 1,
        color: randomColor()
      });
      document.body.appendChild(d);
    }

    function css(css) {
      var style = document.createElement("style");
      style.type = "text/css";
      try {
        style.appendChild(document.createTextNode(css));
      } catch (ex) {
        style.styleSheet.cssText = css;
      }
      document.getElementsByTagName('head')[0].appendChild(style);
    }

    function randomColor() {
      // return "rgb(" + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + "," + (~~(Math.random() * 255)) + ")";
      return "#F44336";
    }

    function addMenuEvent() {
      var menu = document.getElementById('menu-main-post');
      if (menu) {
        var toc = document.getElementById('toc');
        if (toc) {
          menu.onclick = function() {
            if (toc) {
              if (toc.style.display == 'block') {
                toc.style.display = 'none';
              } else {
                toc.style.display = 'block';
              }
            }
          };
        } else {
          menu.style.display = 'none';
        }
      }
    }

  })(window, document);
</script>

  



</body>
</html>
